cpupools: fix state when downing a CPU failed
authorJan Beulich <jbeulich@suse.com>
Mon, 30 Jul 2018 09:23:22 +0000 (11:23 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 30 Jul 2018 09:23:22 +0000 (11:23 +0200)
commit0a2016ca2fabfe674c311dcfd8e15fec0ba3f7b6
treeee31611c18e41dc2240a6fad0bc6074936e9696b
parentb53e0defcea1400c03f83d1d5cc30a3b237c8cfe
cpupools: fix state when downing a CPU failed

While I've run into the issue with further patches in place which no
longer guarantee the per-CPU area to start out as all zeros, the
CPU_DOWN_FAILED processing looks to have the same issue: By not zapping
the per-CPU cpupool pointer, cpupool_cpu_add()'s (indirect) invocation
of schedule_cpu_switch() will trigger the "c != old_pool" assertion
there.

Clearing the field during CPU_DOWN_PREPARE is too early (afaict this
should not happen before cpu_disable_scheduler()). Clearing it in
CPU_DEAD and CPU_DOWN_FAILED would be an option, but would take the same
piece of code twice. Since the field's value shouldn't matter while the
CPU is offline, simply clear it (implicitly) for CPU_ONLINE and
CPU_DOWN_FAILED, but only for other than the suspend/resume case (which
gets specially handled in cpupool_cpu_remove()).

By adjusting the conditional in cpupool_cpu_add() CPU_DOWN_FAILED
handling in the suspend case should now also be handled better.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
master commit: cb1ae9a27819cea0c5008773c68a7be6f37eb0e5
master date: 2018-07-19 09:41:55 +0200
xen/common/cpupool.c